<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'tb-usuarios-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Campos con<span class="required">*</span> son requeridos.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'login'); ?>
		<?php echo $form->textField($model,'login',array('size'=>50,'maxlength'=>50,'readonly'=>!$model->isNewRecord)); ?>
		<?php echo $form->error($model,'login'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'password'); ?>
		<?php echo $form->passwordField($model,'password',array('size'=>20,'maxlength'=>20)); ?>
		<?php echo $form->error($model,'password'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'nombre'); ?>
		<?php echo $form->textField($model,'nombre',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'nombre'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'apellido'); ?>
		<?php echo $form->textField($model,'apellido',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'apellido'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'estado'); ?>
		<?php echo $form->dropDownList($model,'estado',$model->obtenerEstados()); ?>
		<?php //echo $form->textField($model,'estado'); ?>
		<?php echo $form->error($model,'estado'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'tb_tipousuarios_idUserType'); ?>
		<?php echo $form->dropDownList($model,'tb_tipousuarios_idUserType',$model->obtenerRoles(),array('empty'=>'--Seleccione--')); ?>
		<?php /*echo $form->textField($model,'tb_tipousuarios_idUserType');*/ ?>
		<?php echo $form->error($model,'tb_tipousuarios_idUserType'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Crear Usuario' : 'Guardar'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->